Skip to content

PyPI publication workflow: Generate package SBOM in wheel - #140

Merged
JPEWdev merged 11 commits into
JPEWdev:mainfrom
bact:gen-sbom
Aug 19, 2026
Merged

PyPI publication workflow: Generate package SBOM in wheel#140
JPEWdev merged 11 commits into
JPEWdev:mainfrom
bact:gen-sbom

Conversation

@bact

@bact bact commented Aug 11, 2026

Copy link
Copy Markdown
Collaborator

Add Pitloom GitHub Action to generates SBOM and put it in the wheel for publication on PyPI.

Add "pitllom" to Hatchling build hook to get SBOM and put it in the wheel.

Signed-off-by: Arthit Suriyawongkul <arthit@gmail.com>
@bact bact added enhancement New feature or request documentation Improvements or additions to documentation labels Aug 11, 2026
@bact
bact marked this pull request as draft August 11, 2026 14:20
@bact

bact commented Aug 11, 2026

Copy link
Copy Markdown
Collaborator Author

Python 3.9 is not supported yet.
May need to revise Pitloom to lower its Python version requirement.

@github-actions

Copy link
Copy Markdown

Coverage report

This PR does not seem to contain any modification to coverable code.

Signed-off-by: Arthit Suriyawongkul <arthit@gmail.com>
@bact

bact commented Aug 11, 2026

Copy link
Copy Markdown
Collaborator Author

Hatchling's SBOM embedding feature is only from Hatchling 1.29.0, which requires Python >= 3.10. So even Pitloom can generate the SBOM, but Hatchling will not embed the file in the wheel.

@bact

bact commented Aug 11, 2026

Copy link
Copy Markdown
Collaborator Author

Will see if we can inject the SBOM manually.
If we can lower Hatchling requirement to 1.27, we can support Python 3.9

bact added 6 commits August 11, 2026 17:34
Signed-off-by: Arthit Suriyawongkul <arthit@gmail.com>
Signed-off-by: Arthit Suriyawongkul <arthit@gmail.com>
Signed-off-by: Arthit Suriyawongkul <arthit@gmail.com>
Signed-off-by: Arthit Suriyawongkul <arthit@gmail.com>
@bact

bact commented Aug 18, 2026

Copy link
Copy Markdown
Collaborator Author

Switch to Pitloom GitHub Action, which works with Python < 3.10.


See wheels (*.whl) from these packages for examples of generated SBOM by Pitloom

(SBOM quality are vary by dependencies and types of files in the project. The sentimentdemo is worst, as there are lot of text files without version information.)

@bact
bact requested a review from JPEWdev August 18, 2026 13:24
bact added 2 commits August 18, 2026 14:29
Signed-off-by: Arthit Suriyawongkul <arthit@gmail.com>
Better put it only during CI

Signed-off-by: Arthit Suriyawongkul <arthit@gmail.com>
@bact
bact removed the request for review from JPEWdev August 18, 2026 13:32
@bact
bact marked this pull request as ready for review August 18, 2026 13:38
@bact bact changed the title Add Pitloom to generate package SBOM in wheel PyPI publication workflow: Generate package SBOM in wheel Aug 18, 2026
@bact
bact requested a review from JPEWdev August 18, 2026 13:41
embed-wheel: "dist/*.whl"
extras: "content-type"
content-type: "true"

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we run this during the normal build workflow also so there are no surprises when we publish?

@bact bact Aug 18, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes we can. Will update the test.yml for that. Or maybe a dedicated SBOM generation test workflow.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.github/workflows/test-sbom.yaml is now added to run for every PR.

Signed-off-by: Arthit Suriyawongkul <arthit@gmail.com>
@bact
bact requested a review from JPEWdev August 19, 2026 18:33
@JPEWdev
JPEWdev merged commit a598c79 into JPEWdev:main Aug 19, 2026
11 checks passed
@bact
bact deleted the gen-sbom branch August 20, 2026 06:15
@bact bact added the tests Tests, test spec, test data label Aug 20, 2026
@bact bact linked an issue Aug 20, 2026 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request tests Tests, test spec, test data

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Generate SBOM for shacl2code wheel

2 participants